﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Common.InstanceManager;

namespace LayersDotNet.Desktop
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            RefreshBanks();
        }

        private void RefreshBanks()
        {
            dataGridView1.DataSource = WinApp.DataAccess.BankDA.GetAll();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            WinApp.DataAccess.BankDA.Insert(new Entity.Bank() { Name = "New Bank - Win App" });

            RefreshBanks();
        }
    }
}
